package base.day18.recursion;

public class Recursion {
    public static void main(String[] args) {
        int sum=getSum(100);
        System.out.println(sum);

        int factorial=factorial(5);
        System.out.println(factorial);
    }
    public static int getSum(int a){
        if (a==1){
            return 1;
        }
        else {
            return a+getSum(a-1);
        }
    }
    public static int factorial(int i){
        if (i==1){
            return 1;
        }else {
            return i*factorial(i-1);
        }
    }
}
